<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
	<title>课程管理</title>
	
	<script>
		$(document).ready(function() {
			//聚焦第一个输入框
			$("#task_title").focus();
			//为inputForm注册validate函数
			$("#inputForm").validate();
		});
	</script>
</head>


<body>
	<form:form id="inputForm"  modelAttribute="courseDetail" action="${ctx}/admin/courseDetail/${action}" method="post" class="form-horizontal">
		<input type="hidden" name="id" value="${courseDetail.id}"/>
		<input type="hidden" name="courseId" value="${courseId}"/>
		<fieldset>
			<legend><small>添加课程</small></legend>
			<div class="control-group">
				<label for="task_title" class="control-label">课程名：</label>
				<div class="controls">
					<form:input type="text" path="title" class="input-large required" minlength="3"/>
				</div>
			</div>	
			<div class="control-group">
				<label for="description" class="control-label">课程时间：</label>
				<div class="controls">
					<form:input type="text" path="vedeoTime" class="input-large required" minlength="3"/>
				</div>
			</div>	
			<div class="control-group">
				<label for="description" class="control-label">课程内容：</label>
				<div class="controls">
					<form:textarea path="content" class="input-large required" minlength="3"/>
				</div>
			</div>
			<div class="control-group">
				<label for="description" class="control-label">课程材料：</label>
				<div class="controls">
					<form:input type="text" path="practicePdf"  class="input-large required" minlength="3"/>
				</div>
			</div>
			
			<div class="control-group">
				<label for="description" class="control-label">是否公开播放：</label>
				<div class="controls">
					<form:checkbox  path="viewOpen" class="input-large required"/>
				</div>
			</div>
			
			<div class="form-actions">
				<input id="submit_btn" class="btn btn-primary" type="submit" value="提交"/>&nbsp;	
				<input id="cancel_btn" class="btn" type="button" value="返回" onclick="history.back()"/>
			</div>
		</fieldset>
	</form:form>
	<ckeditor:replace replace="content" basePath="${ctx}/ckeditor/" />
</body>
</html>